The stream of data being sent is packed into small packages (or segments), called a datagramm, for transmission.
Then TCP puts a header in each datagram. This header contains vital information like sequence number and a checksum.
The sequence number is used to reassemble the datagrams on the other end in correct order, as it can happen, that, let's say
datagram #20 arrives before datagram #19. The checksum is used to ensure correct receipt of the datagram. The checksum is a number,
created by summing up all the
octet
in a datagram.
The sender and receiver are always sending receipts acknowledgements to ensure datagramms were received and processed correctly. If the sender does not receive an acknowledgement within a certain time, then it sends the according datagramm again.
IP is the abbreviation of Internet Protocol. Its basic functions are addressing and fragmentation.
TCP passes all the datagrams along with their
IP-address
along to IP, which sends the datagram on its way. IP also adds a header with a checksum
and all that kind of stuff to ensure correct transmission. IP uses the addresses carried in the Internet header to transmit Internet datagrams
toward their destinations. The selection of a path for transmission is called routing. It also splits up (fragments) datagramms for
transmission through small package networks.